import { CommonType } from '../../../dto/common.type';
import { Field, ObjectType } from '@nestjs/graphql';

@ObjectType()
export class ProductType extends CommonType {
  @Field({
    description: '名称',
  })
  name: string;

  @Field({
    description: '描述',
    nullable: true,
  })
  desc: string;

  @Field({
    description: '库存总数',
  })
  stock: number;

  @Field({
    description: '分类',
    nullable: true,
  })
  type: string;

  @Field({
    description: '售出总数',
  })
  sellNum: number;

  @Field({
    description: '每人限购数量',
  })
  limitBuyNum: number;

  @Field({
    description: '封面',
  })
  cover: string;

  @Field({
    description: '上下架状态',
  })
  status: string;

  @Field({
    description: '头部banner图',
  })
  bannerUrl: string;

  @Field({
    description: '原价',
  })
  originPrice: number;

  @Field({
    description: '优惠价格',
  })
  preferentialPrice: number;

  @Field({
    description: '所属机构',
  })
  orgId: string;

  @Field({
    nullable: true,
    description: '消费卡',
  })
  cards: string;
}
